package com.shm.singlecamera.UI;

import android.graphics.Rect;

public class ItemTransformer implements WheelItemTransformer {
    @Override
    public void transform(WheelView.ItemState itemState, Rect itemBounds) {
        float scale = itemState.getAngleFromSelection() * 0.014f;
        scale = Math.min(1.12f, 1.15f - Math.min(0.25f, Math.abs(scale)));
        Circle bounds = itemState.getBounds();
        float radius = bounds.getRadius() * scale;

        float abs_x = bounds.getCenterX();
        float abs_y = bounds.getCenterY();

        itemBounds.set(Math.round(abs_x - radius), Math.round(abs_y - radius),
                Math.round(abs_x + radius), Math.round(abs_y + radius));

    }
}
